package com.rd.student.jiaji.class2.duyukun.Day0727;

import com.rd.student.jiaji.class4.suyan.zrrd.homework2.作业练习第二种方法;

import java.util.Scanner;

public class Test {

    public static void test1(){
        //将年龄转化为天数
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的年龄：");
        int age = scanner.nextInt();
        int day = age * 365;
        System.out.println("将你的年龄转化为天数是：" + day + "天");
    }

    public static void test2(){
        //计算两个数是否大于100
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个数字：");
        int num1 = scanner.nextInt();
        Scanner scanner1 = new Scanner(System.in);
        System.out.println("请输入第二个数字：");
        int num2 = scanner1.nextInt();
        if (100 < num1 + num2){
            System.out.println("这两个数字的和大于100");
        }else if (100 > num1 + num2){
            System.out.println("这两个数字的和小于100");
        } else if (100 == num1 + num2) {
            System.out.println("这两个数字的和等于100");

        }
    }

    public static void test3(){
        //多边形内角和
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你想查询的多边形边数");
        int d = scanner.nextInt();
        if (d <= 2){
            System.out.println("输入错误请输入正确边数！");
        } else if (d > 2) {
            int num = (d - 2)* 180;
            System.out.println(d + "边形的内角和为：" + num + "度。" );

        }
    }


    public static void test4(){

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你想运算的符号： 1.'+' 2.'-' 3.'*' 4.'/'");
        int sym = scanner.nextInt();
        if (sym == 1){
            Scanner scanner1 = new Scanner(System.in);
            Scanner scanner2 = new Scanner(System.in);
            System.out.println("请输入你想运算的两个数字：");
            int num1 = scanner1.nextInt();
            int num2 = scanner2.nextInt();

            int num = num1 + num2;
            System.out.println("运算结果为" + num1 + " + " + num2 + " = " + num);
        }else if (sym == 2) {
            Scanner scanner1 = new Scanner(System.in);
            Scanner scanner2 = new Scanner(System.in);
            System.out.println("请输入你想运算的两个数字：");
            int num1 = scanner1.nextInt();
            int num2 = scanner2.nextInt();

            int num = num1 - num2;
            System.out.println("运算结果为" + num1 + " - " + num2 + " = " + num);

        }else if (sym == 3) {
            Scanner scanner1 = new Scanner(System.in);
            Scanner scanner2 = new Scanner(System.in);
            System.out.println("请输入你想运算的两个数字：");
            int num1 = scanner1.nextInt();
            int num2 = scanner2.nextInt();

            int num = num1 * num2;
            System.out.println("运算结果为" + num1 + " * " + num2 + " = " + num);

        }else if (sym == 4) {
            Scanner scanner1 = new Scanner(System.in);
            Scanner scanner2 = new Scanner(System.in);
            System.out.println("请输入你想运算的两个数字：");
            double num1 = scanner1.nextInt();
            double num2 = scanner2.nextInt();

            double num = num1 / num2;
            System.out.println("运算结果为" + num1 + " / " + num2 + " = " + num);

        }else{
            System.out.println("输入错误！");
        }
    }



    public static void main(String[] args) {
        //test1();
        //test2();
        //test3();
        test4();
    }
}
